/*
 */
package org.vectrics.recruiter.user;

import java.util.Collection;
import java.util.Date;
import java.util.HashSet;

import org.vectrics.common.db.ChangeReportable;
import org.vectrics.common.db.OwnedObject;
import org.vectrics.common.db.RecordObject;
import org.vectrics.domain.Domain;
import org.vectrics.recruiter.job.Job;
import org.vectrics.user.Person;

/**
 * @author mmoore
 */
public class ResumeScanBatch implements RecordObject, OwnedObject, ChangeReportable {
    public static int STATUS_NOT_RUN = 0;
    public static int STATUS_RUNNING = 1;
    public static int STATUS_FINISHED = 2;
    
    private Long id = null;
    private Date runDate = null;
    private Date runCompletionDate = null;
    private Job job = null;
    private Person runPerson = null;
    private Date expireDate = null;
    private String description = null;
    private Collection criteriaList = new HashSet();
    private Integer maxResumeAge = new Integer(90);
    private boolean shared = false;
    private int status = STATUS_NOT_RUN;
    private Domain domain = null;
    
    private boolean includeInactiveResumes = true;
    private Long minimumPercent = new Long(70);
    private Long maximumCount = new Long(100);
    private Long minimumCount = new Long(20);

    /**
     * @return Returns the description.
     */
    public String getDescription() {
        return description;
    }
    /**
     * @param description The description to set.
     */
    public void setDescription(String description) {
        this.description = description;
    }
    /**
     * @return Returns the expireDate.
     */
    public Date getExpireDate() {
        return expireDate;
    }
    /**
     * @param expireDate The expireDate to set.
     */
    public void setExpireDate(Date expireDate) {
        this.expireDate = expireDate;
    }
    /**
     * @return Returns the id.
     */
    public Long getId() {
        return id;
    }
    /**
     * @param id The id to set.
     */
    public void setId(Long id) {
        this.id = id;
    }
    /**
     * @return Returns the runDate.
     */
    public Date getRunDate() {
        return runDate;
    }
    /**
     * @param runDate The runDate to set.
     */
    public void setRunDate(Date runDate) {
        this.runDate = runDate;
    }
    /**
     * @return Returns the runPerson.
     */
    public Person getRunPerson() {
        return runPerson;
    }
    /**
     * @param runPerson The runPerson to set.
     */
    public void setRunPerson(Person runPerson) {
        this.runPerson = runPerson;
        if (this.getDomain() == null)
        	this.setDomain(runPerson.getDomain());
    }
    
    
    /**
     * @return Returns the criteriaList.
     */
    public Collection getCriteriaList() {
        return criteriaList;
    }
    /**
     * @param criteriaList The criteriaList to set.
     */
    public void setCriteriaList(Collection criteriaList) {
        this.criteriaList = criteriaList;
    }
    
    public void addCriteria(ResumeScanCriteria criteria) {
        criteria.setBatch(this);
        this.criteriaList.add(criteria);
    }
    
    
    /**
     * @return Returns the maxResumeAge.
     */
    public Integer getMaxResumeAge() {
        return maxResumeAge;
    }
    /**
     * @param maxResumeAge The maxResumeAge to set.
     */
    public void setMaxResumeAge(Integer maxResumeAge) {
        this.maxResumeAge = maxResumeAge;
    }
    
    /**
     * @return Returns the shared.
     */
    public boolean getShared() {
        return shared;
    }
    /**
     * @param shared The shared to set.
     */
    public void setShared(boolean shared) {
        this.shared = shared;
    }
    
    /**
     * @return Returns the status.
     */
    public int getStatus() {
        return status;
    }
    
    /**
     * @param status The status to set.
     */
    public void setStatus(int status) {
        this.status = status;
    }
    
    
    /**
     * @return Returns the job.
     */
    public Job getJob() {
        return job;
    }
    /**
     * @param job The job to set.
     */
    public void setJob(Job job) {
        this.job = job;
    }
    
    
	/**
	 * @return Returns the runCompletionDate.
	 */
	public Date getRunCompletionDate() {
		return runCompletionDate;
	}
	/**
	 * @param runCompletionDate The runCompletionDate to set.
	 */
	public void setRunCompletionDate(Date runCompletionDate) {
		this.runCompletionDate = runCompletionDate;
	}
	
	
	/**
	 * @return Returns the includeInactiveResumes.
	 */
	public boolean getIncludeInactiveResumes() {
		return includeInactiveResumes;
	}
	/**
	 * @param includeInactiveResumes The includeInactiveResumes to set.
	 */
	public void setIncludeInactiveResumes(boolean includeInactiveResumes) {
		this.includeInactiveResumes = includeInactiveResumes;
	}
	/**
	 * @return Returns the maximumCount.
	 */
	public Long getMaximumCount() {
		return maximumCount;
	}
	/**
	 * @param maximumCount The maximumCount to set.
	 */
	public void setMaximumCount(Long maximumCount) {
		this.maximumCount = maximumCount;
	}
	/**
	 * @return Returns the minimumCount.
	 */
	public Long getMinimumCount() {
		return minimumCount;
	}
	/**
	 * @param minimumCount The minimumCount to set.
	 */
	public void setMinimumCount(Long minimumCount) {
		this.minimumCount = minimumCount;
	}
	/**
	 * @return Returns the minimumPercent.
	 */
	public Long getMinimumPercent() {
		return minimumPercent;
	}
	/**
	 * @param minimumPercent The minimumPercent to set.
	 */
	public void setMinimumPercent(Long minimumPercent) {
		this.minimumPercent = minimumPercent;
	}
	
	/**
	 * @return Returns the domain.
	 */
	public Domain getDomain() {
		return domain;
	}
	
	/**
	 * @param domain The domain to set.
	 */
	public void setDomain(Domain domain) {
		this.domain = domain;
	}
	
}
